﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using University.Workshop.Model;
using System.Data.SqlClient;
using System.Data;


namespace University.Workshop.DataAccess
{
    public static class PrescriptionsDataAccess
    {
        static MedicalCenterEntities entities = MedicalCenterEntities.Instance;

        public static bool AddPrescriptions(ICollection<Prescription> prescription)
        {
            List<Prescription> prescriptions = (List<Prescription>)prescription;
            bool verify = true;
            if (prescriptions != null)
            {
                for (int j = 0; j < prescriptions.Count; j++)
                {
                    entities.Prescriptions.Add(prescriptions[j]);
                    entities.SaveChanges();
                }

            }
            
            return verify;
        }
    }
}
